package com.core.website.api;

import com.core.website.common.Result;
import com.core.website.common.ResultUtil;
import com.core.website.entity.Banner;
import com.core.website.entity.Team;
import com.core.website.service.BannerService;
import com.core.website.service.TeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/teamApi")
public class TeamApi {

    @Autowired
    private TeamService teamService;
    @PostMapping("/add")
    public Result add(@RequestBody Team team){
        int result=teamService.add(team);
        return ResultUtil.success(result);
    }
    @PostMapping("/edit")
    public Result edit(@RequestBody Team team){
        int result=teamService.edit(team);
        return ResultUtil.success(result);
    }
    @PostMapping("/delete")
    public Result delete(@RequestBody List<String> ids){
        int result=teamService.delete(ids);
        return ResultUtil.success(result);
    }
    @PostMapping("/queryAll")
    public Result queryAll(@RequestBody Team team){
        List<Team> result=teamService.queryAll(team);
        return ResultUtil.success(result);
    }
    @GetMapping("/queryOne")
    public Result queryOne(String id){
        Team result=teamService.queryOne(id);
        return ResultUtil.success(result);
    }
}
